<title>角色管理</title>
<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>权限管理</cite></a>
        <a><cite>角色管理</cite></a>
    </div>
</div>

<div class="layui-fluid">
    <div class="layui-card">
        <!-- 检索 -->
        <div class="layui-form layui-card-header layuiadmin-card-header-auto groupSearchForm"
             lay-filter="groupPage">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">组名</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input searchField" name="name" operator="LIKE" placeholder="请输入组名"
                               render="tag" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-admin" lay-filter="groupSearch" lay-submit>
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">
            <div style="padding-bottom: 10px;">
                <script id="groupToolBar" type="text/html">
                    {{# if(common.checkAuth("del")){ }}
                    <button class="layui-btn layuiadmin-btn-admin layui-btn-danger" lay-event="batchDel"><i
                            class="layui-icon layui-icon-delete"></i>删除
                    </button>
                    {{# } }}
                    {{# if(common.checkAuth("add")){ }}
                    <button class="layui-btn layuiadmin-btn-admin" lay-event="add"><i
                            class="layui-icon layui-icon-add-1"></i>添加
                    </button>
                    {{# } }}
                </script>
            </div>
            <!-- 表格 -->
            <table id="groupTable" lay-filter="groupTable"></table>
            <!-- 操作 -->
            <script id="groupTableTool" type="text/html">
                {{# if(common.checkAuth("edit")){ }}
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
                        class="layui-icon layui-icon-edit"></i>编辑</a>
                {{# } }}
                {{# if(common.checkAuth("del")){ }}
                {{# if(d.id == '1'){ }}
                <a class="layui-btn layui-btn-disabled layui-btn-xs"><i
                        class="layui-icon layui-icon-delete"></i>删除</a>
                {{# } else { }}
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
                        class="layui-icon layui-icon-delete"></i>删除</a>
                {{# } }}
                {{# } }}
            </script>
            <!-- 状态开关组件 -->
            <script id="groupStatusSwitch" type="text/html">
                <div class="layui-form-item">
                {{# if(common.checkAuth("edit")){ }}
                    {{# if(d.status == '1'){ }}
                    <input type="checkbox" name="status" checked data-id="{{d.id}}" lay-skin="switch"
                           title="启用|禁用"
                           lay-filter="groupStatusSwitch">
                    {{# } else { }}
                    <input type="checkbox" name="status" data-id="{{d.id}}" lay-skin="switch" title="启用|禁用"
                           lay-filter="groupStatusSwitch">
                    {{# } }}
                {{# }else{ }}
                    {{# if(d.status == '1'){ }}
                    <span class="blue-color">启用</span>
                    {{# } else { }}
                    <span class="red-color">禁用</span>
                    {{# } }}
                {{# } }}
                </div>
            </script>
        </div>
    </div>
</div>

<script src="../web/res/js/auth/group/index.js"></script>
